

function ajaxFileUpload()
{
    //starting setting some animation when the ajax starts and completes
    j("#loading")
    .ajaxStart(function(){
        j(this).show();
    })
    .ajaxComplete(function(){
        j(this).hide();
    });
    
    /*
        prepareing ajax file upload
        url: the url of script file handling the uploaded files
                    fileElementId: the file type of input element id and it will be the index of  $_FILES Array()
        dataType: it support json, xml
        secureuri:use secure protocol
        success: call back function when the ajax complete
        error: callback function when the ajax failed
        
            */
    j.ajaxFileUpload
    (
        {
            url:"doajaxfileupload.php", //../assets/plugins/dataFrolic/
            secureuri:false,
            fileElementId:'df_image_upload',
            dataType: 'json',
            success: function (data, status)
            {
                if(typeof(data.error) != 'undefined')
                {
                    if(data.error != '')
                    {
                        alert(data.error);
                    }else
                    {
                        console.log(data.msg);
                    }
                }
            },
            error: function (data, status, e)
            {
                alert(e);
            }
        }
    )
    
    return false;

}